/********************************************************************************
 * Project Name		[JavaSE_Fundamentals]
 * File Name     	[NewEqualsAndHashCodeMethod.java]
 * Creation Date 	[2015-01-01]
 * 
 * Copyright© ge.y.yang@gmail.com All Rights Reserved
 * 
 * Work hard, play harder, think big and keep fit
 ********************************************************************************/
package jdk7;

import java.util.Objects;

/**
 * @author 不落的太阳(Sean Yang aka ShortPeace)
 * @version 1.0
 * @since jdk 1.8
 * 
 */
public class NewEqualsAndHashCodeMethod {

	private int id;
	private String description;

	@Override
	public int hashCode() {
		return Objects.hash(id, description);
	}

	@Override
	public boolean equals(Object other) {
		return Objects.equals(this.id, ((NewEqualsAndHashCodeMethod) other).id)
				&& Objects.equals(this.description, ((NewEqualsAndHashCodeMethod) other).description);
	}
}
